<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:c="http://java.sun.com/jstl/core"
	template="/template/template.xhtml" xmlns:p="http://primefaces.org/ui">

	<ui:define name="template_head">
		<title><h:outputText value="#{msg['room.title']}" /></title>
	</ui:define>

	<ui:define name="template_body">
		<h:form id="frmSalle">
			<p:toolbar>
		        <f:facet name="left">
		            <p:commandButton type="push" title="#{msg['button.new']}" icon="ui-icon-document"
		            	action="#{salleBn.initCreer}" />
		            <p:commandButton type="push" title="#{msg['button.delete']}" icon="ui-icon-trash"
		            	action="#{salleBn.supprimer(null)}" ajax="false" />
		        </f:facet>
	        </p:toolbar>
			<p:panel header="Recherche salle">
				<p:panelGrid>
					<p:row>
						<p:column colspan="2"><h:outputLabel for="codeSalle" value="#{msg['room.field.code']}" />
						<h:inputText id="codeSalle" value="#{salleBn.selectedSalle.codeSalle}"
							size="16" maxlength="16" /></p:column>
						<p:column colspan="2"><h:outputLabel for="nomSalle" value="#{msg['room.field.name']}" />
						<h:inputText id="nomSalle" value="#{salleBn.selectedSalle.nomSalle}"
							size="30" maxlength="30" /></p:column>
						<p:column></p:column>
					</p:row>
					<p:row>
						<p:column colspan="4"><p:spacer /></p:column>
			            <p:column>
			            	<p:commandButton type="reset" title="#{msg['button.reset']}" value="#{msg['button.reset']}" />
			            	<p:commandButton title="#{msg['button.search']}"
			            		value="#{msg['button.search']}"
			            		action="#{salleBn.rechercher}" />
			            </p:column>
		            </p:row>
				</p:panelGrid>
			</p:panel>
	        <p:messages autoUpdate="true" />
			<p:dataTable id="salleDatatable" emptyMessage="#{msg['table.empty']}"
					var="salleIt" value="#{salleBn.salleList}">
			 	<f:facet name="header">
					<h:outputText value="#{msg['room.table.title']}" />
			    </f:facet>
			    <p:column headerText="#{msg['room.field.code']}">
			        <h:outputText value="#{salleIt.codeSalle}" />
			    </p:column>
			    <p:column headerText="#{msg['room.field.name']}">
			        <h:outputText value="#{salleIt.nomSalle}" />
			    </p:column>
			    <p:column headerText="#{msg['room.field.description']}">
			        <h:outputText value="#{salleIt.descriptionSalle}" />
			    </p:column>
			    <p:column width="8%">
		            <p:commandButton title="#{msg['button.update']}" icon="ui-icon-pencil"
		            	action="#{salleBn.initModifier(salleIt)}" ajax="false"/>
			    </p:column>
			    <p:column width="8%">
		            <p:commandButton title="#{msg['button.delete']}" icon="ui-icon-trash"
		            	action="#{salleBn.supprimer(salleIt.id)}" />
			    </p:column>
			</p:dataTable>
		</h:form>
	</ui:define>
</ui:composition>